home *** CD-ROM | disk | FTP | other *** search
/ Workbench Add-On / Workbench Add-On - Volume 1.iso / Dev / Oberon / source / amiga / DiskFont.mod < prev    next >
Text File  |  1995-06-29  |  21KB  |  563 lines

  1. (***************************************************************************
  2.  
  3.      $RCSfile: DiskFont.mod $
  4.   Description: Interface to diskfont.library
  5.  
  6.    Created by: fjc (Frank Copeland)
  7.     $Revision: 3.8 $
  8.       $Author: fjc $
  9.         $Date: 1995/06/04 23:13:14 $
  10.  
  11.   Includes Release 40.15
  12.  
  13.   (C) Copyright 1985-1993 Commodore-Amiga, Inc.
  14.       All Rights Reserved
  15.  
  16.   Oberon-A interface Copyright © 1994-1995, Frank Copeland.
  17.   This file is part of the Oberon-A Interface.
  18.   See Oberon-A.doc for conditions of use and distribution.
  19.  
  20. ***************************************************************************)
  21.  
  22. <* STANDARD- *>
  23.  
  24. MODULE [2] DiskFont;
  25.  
  26. IMPORT
  27.   SYS := SYSTEM, Kernel, e := Exec, d := Dos, u := Utility, gfx := Graphics,
  28.   s := Sets;
  29.  
  30.  
  31. (*
  32. **      $VER: diskfont.h 38.0 (18.6.92)
  33. **
  34. **      diskfont library definitions
  35. **
  36. **      (C) Copyright 1990 Robert R. Burns
  37. **          All Rights Reserved
  38. *)
  39.  
  40.  
  41. CONST
  42.  
  43.   maxFontPath * = 256;   (* including null terminator *)
  44.  
  45. TYPE
  46.  
  47.   FontContentsPtr * = POINTER TO FontContents;
  48.   FontContents * = RECORD
  49.     fileName * : ARRAY maxFontPath OF CHAR;
  50.     ySize *    : e.UWORD;
  51.     style *    : s.SET8;
  52.     flags *    : s.SET8;
  53.   END; (* FontContents *)
  54.  
  55.   TFontContentsPtr * = POINTER TO TFontContents;
  56.   TFontContents * = RECORD
  57.     fileName * : ARRAY maxFontPath - 2 OF CHAR;
  58.     tagCount * : e.UWORD;       (* including the tagDONE tag *)
  59.     (*
  60.      *  if tagCount is non-zero, fileName is overlayed with
  61.      *  Text Tags starting at:  SYS.VAL (u.TagItemPtr,
  62.      *    SYS.ADR (fileName[maxFontPath-(tagCount*SIZE (u.TagItem))]))
  63.      *)
  64.     ySize *    : e.UWORD;
  65.     style *    : s.SET8;
  66.     flags *    : s.SET8;
  67.   END; (* TFontContents *)
  68.  
  69.  
  70. CONST
  71.  
  72.   fchId *  = 0F00H;  (* FontContentsHeader, then FontContents *)
  73.   tfchId * = 0F02H;  (* FontContentsHeader, then TFontContents *)
  74.   ofchId * = 0F03H;  (* FontContentsHeader, then TFontContents,
  75.                       * associated with outline font *)
  76.  
  77. TYPE
  78.  
  79.   FontContentsHeaderPtr * = POINTER TO FontContentsHeader;
  80.   FontContentsHeader * = RECORD
  81.     fileID *     : e.UWORD; (* fchID *)
  82.     numEntries * : e.UWORD; (* the number of FontContents elements *)
  83.   (**fc *         : ARRAY numEntries OF FontContents or
  84.     tfc *        : ARRAY numEntries OF TFontContents *)
  85.   END; (* FontContentsHeader *)
  86.  
  87.  
  88. CONST
  89.  
  90.   dfhId *       = 0F80H;
  91.   maxFontName * =    32; (* font name including ".font\0" *)
  92.  
  93. TYPE
  94.  
  95.   DiskFontHeaderPtr * = POINTER TO DiskFontHeader;
  96.  
  97.     (* the following 8 bytes are not actually considered a part of the  *)
  98.     (* DiskFontHeader, but immediately preceed it. The nextSegment is   *)
  99.     (* supplied by the linker/loader, and the returnCode is the code    *)
  100.     (* at the beginning of the font in case someone runs it...          *)
  101.     (*   nextSegment : e.ULONG;              (* actually a BPTR *)      *)
  102.     (*   returnCode  : e.ULONG;              (* MOVEQ #0,D0 : RTS *)    *)
  103.     (* here then is the official start of the DiskFontHeader...         *)
  104.   DiskFontHeader * = RECORD (e.NodeBase)
  105.     df *       : e.Node;             (* node to link disk fonts *)
  106.     fileID *   : e.UWORD;            (* dfhID *)
  107.     revision * : e.UWORD;            (* the font revision *)
  108.     segment *  : e.BPTR;             (* the segment address when loaded *)
  109.     name *     : ARRAY maxFontName OF CHAR; (* the font name (null terminated) *)
  110.     tf *       : gfx.TextFont;       (* loaded TextFont structure *)
  111.   END; (* DiskFontHeader *)
  112.  
  113. (* unfortunately, this needs to be explicitly typed *)
  114. (* used only if tf.tfStyle fsTagged bit is set *)
  115.  
  116. (*  DiskFontHeader.tagList = DiskFontHeader.segment; (* destroyed during loading *)*)
  117.  
  118.  
  119. CONST
  120.  
  121.   memory * = 0;
  122.   disk * =   1;
  123.   scaled * = 2;
  124.   bitmap * = 3;
  125.  
  126.   tagged * = 16;      (* return TAvailFonts *)
  127.  
  128. TYPE
  129.  
  130.   AvailFontPtr * = POINTER TO AvailFont;
  131.   AvailFont * = RECORD
  132.     type * : s.SET16;        (* MEMORY, DISK, or SCALED *)
  133.     attr * : gfx.TextAttr;    (* text attributes for font *)
  134.   END; (* AvailFont *)
  135.  
  136.   TAvailFontPtr * = POINTER TO TAvailFont;
  137.   TAvailFont * = RECORD
  138.     Type * : s.SET16;       (* MEMORY, DISK, or SCALED *)
  139.     Attr * : gfx.TTextAttr;  (* text attributes for font *)
  140.   END; (* TAvailFont *)
  141.  
  142.   AvailFontsHeaderPtr * = POINTER TO AvailFontsHeader;
  143.   AvailFontsHeader * = RECORD
  144.     numEntries * : e.UWORD;      (* number of AvailFonts elements *)
  145.   (**af *         : ARRAY numEntries OF AvailFont or
  146.     taf *         : ARRAY numEntries OF TAvailFont*)
  147.   END; (* AvailFontsHeader *)
  148.  
  149.  
  150. (*
  151. **      $VER: diskfonttag.h 10.4 (14.7.92)
  152. **
  153. **      libraries/diskfonttag.h -- tag definitions for .otag files
  154. **
  155. **      (C) Copyright 1990-1992 Robert R. Burns
  156. **          All Rights Reserved
  157. *)
  158.  
  159. CONST
  160.  
  161. (* Level 0 entries never appear in the .otag tag list, but appear in font
  162.  * specifications *)
  163.    level0 *   =   u.user;
  164. (* Level 1 entries are required to exist in the .otag tag list *)
  165.    level1 *   =   u.user + 1000H;
  166. (* Level 2 entries are optional typeface metric tags *)
  167.    level2 *   =   u.user + 2000H;
  168. (* Level 3 entries are required for some engines *)
  169.    level3 *   =   u.user + 3000H;
  170. (* Indirect entries are at (tag address + data offset) *)
  171.    indirect * =   8000H;
  172.  
  173. (********************************************************************)
  174. (* font specification and inquiry tags *)
  175.  
  176. (* !  tags flagged with an exclaimation mark are valid for
  177.  *    specification.
  178.  *  ? tags flagged with a question mark are valid for inquiry
  179.  *
  180.  * fixed binary numbers are encoded as 16 bits of integer and
  181.  * 16 bits of fraction.  Negative values are indicated by twos
  182.  * complement of all 32 bits.
  183.  *)
  184.  
  185. (* !  deviceDPI specifies the target device dots per inch -- X DPI is
  186.  *    in the high word, Y DPI in the low word. *)
  187.   deviceDPI * = level0 + 01H;                (* == taDeviceDPI *)
  188.  
  189. (* !  dotSize specifies the target device dot size as a percent of
  190.  *    it's resolution-implied size -- X percent in high word, Y percent
  191.  *    in low word. *)
  192.   dotSize * = level0 + 02H;
  193.  
  194. (* !  OT_Point_Height specifies the requested point height of a typeface,
  195.  *    specifically, the height and nominal width of the em-square.
  196.  *    The point referred to here is 1/72".  It is encoded as a fixed
  197.  *    binary number. *)
  198.   pointHeight * = level0 + 08H;
  199.  
  200. (* !  setFactor specifies the requested set width of a typeface.
  201.  *    It distorts the width of the em-square from that specified by
  202.  *    pointHeight.  To compensate for a device with different
  203.  *    horizontal and vertical resolutions, deviceDpi should be used
  204.  *    instead.  For a normal aspect ratio, set to 1.0 (encoded as
  205.  *    0x00010000).  This is the default value. *)
  206.   setFactor * = level0 + 09H;
  207.  
  208. (* !  shear... specifies the Sine and Cosine of the vertical stroke
  209.  *    angle, as two fixed point binary fractions.  Both must be specified:
  210.  *    first the Sine and then the Cosine.  Setting the sine component
  211.  *    changes the Shear to an undefined value, setting the cosine
  212.  *    component completes the Shear change to the new composite value.
  213.  *    For no shear, set to 0.0, 1.0 (encoded as 0x00000000, 0x00010000).
  214.  *    This is the default value. *)
  215.   shearSin * = level0 + 0AH;
  216.   shearCos * = level0 + 0BH;
  217.  
  218. (* !  rotate... specifies the Sine and Cosine of the baselin rotation
  219.  *    angle, as two fixed point binary fractions.  Both must be specified:
  220.  *    first the Sine and then the Cosine.  Setting the sine component
  221.  *    changes the Shear to an undefined value, setting the cosine
  222.  *    component completes the Shear change to the new composite value.
  223.  *    For no shear, set to 0.0, 1.0 (encoded as 0x00000000, 0x00010000).
  224.  *    This is the default value. *)
  225.   rotateSin * = level0 + 0CH;
  226.   rotateCos * = level0 + 0DH;
  227.  
  228. (* !  embolden... specifies values to algorithimically embolden -- or,
  229.  *    when negative, lighten -- the glyph.  It is encoded as a fixed point
  230.  *    binary fraction of the em-square.  The X and Y components can be
  231.  *    changed indendently.  For normal characters, set to 0.0, 0.0
  232.  *    (encoded as 0x00000000, 0x00000000).  This is the default value. *)
  233.   emboldenX * = level0 + 0EH;
  234.   emboldenY * = level0 + 0FH;
  235.  
  236. (* !  pointSize is an old method of specifying the point size,
  237.  *    encoded as (points * 16). *)
  238.   pointSize * = level0 + 10H;
  239.  
  240. (* !  glyphCode specifies the glyph (character) code to use with
  241.  *    subsequent operations.  For example, this is the code for an
  242.  *    glyph inquiry *)
  243.   glyphCode * = level0 + 11H;
  244.  
  245. (* !  glyphCode2 specifies the second glyph code.  For example,
  246.  *    this is the right glyph of the two glyphs of an kernPair
  247.  *    inquiry *)
  248.   glyphCode2 * = level0 + 12H;
  249.  
  250. (* !  glyphWidth specifies a specific width for a glyph.
  251.  *    It sets a specific escapement (advance) width for subsequent
  252.  *    glyphs.  It is encoded as a fixed binary fraction of the em-square.
  253.  *    To revert to using the font-defined escapement for each glyph, set
  254.  *    to 0.0 (encoded as 0x00000000).  This is the default value. *)
  255.   glyphWidth * = level0 + 13H;
  256.  
  257. (* !  oTagPath and
  258.  * !  oTagList specify the selected typeface.  Both must be specified:
  259.  *    first the Path and then the List.  Setting the path name changes
  260.  *    changes the typeface to an undefined value, providing the List
  261.  *    completes the typeface selection to the new typeface.  OTagPath
  262.  *    is the null terminated full file path of the .otag file associated
  263.  *    with the typeface.  OTagList is a memory copy of the processed
  264.  *    contents of that .otag file (i.e. with indirections resolved).
  265.  *    There are no default values for the typeface. *)
  266.   oTagPath * = level0 + indirect + 14H;
  267.   oTagList * = level0 + indirect + 15H;
  268.  
  269. (*  ? glyphMap supplies a read-only struct GlyphMap pointer that
  270.  *    describes a bitmap for a glyph with the current attributes. *)
  271.   glyphMap * = level0 + indirect + 20H;
  272.  
  273. (*  ? widthList supplies a read-only struct MinList of struct
  274.  *    GlyphWidthEntry nodes for glyphs that are defined from GlyphCode
  275.  *    to GlyphCode2, inclusive.  The widths are represented as fixed
  276.  *    binary fractions of the em-square, ignoring any effect of
  277.  *    SetFactor or GlyphWidth.  A width would need to be converted to
  278.  *    a distance along the baseline in device units by the
  279.  *    application. *)
  280.   widthList * = level0 + indirect + 21H;
  281.  
  282. (*  ? ...KernPair supplies the kern adjustment to be added to the
  283.  *    current position after placement of the GlyphCode glyph and
  284.  *    before placement of the GlyphCode2 glyph.  Text kern pairs are
  285.  *    for rendering body text.  Display kern pairs are generally
  286.  *    tighter values for display (e.g. headline) purposes.  The
  287.  *    adjustment is represented as a fixed binary fraction of the
  288.  *    em-square, ignoring any effect of SetFactor.  This number would
  289.  *    need to be converted to a distance along the baseline in device
  290.  *    units by the application. *)
  291.   textKernPair * = level0 + indirect + 22H;
  292.   designKernPair * = level0 + indirect + 23H;
  293.  
  294. (*  ? underlined is an unsigned word which is used to request
  295.  *    algorithimic underlining for the engine when rendering the glyph.
  296.  *    Bullet.library currently does not support this tag, though it
  297.  *    may be used by other engines in the future.  The default for
  298.  *    any engine which supports this tag must be ulNone.  Engines which
  299.  *    do not support this tag should return an appropriate err value.
  300.  *
  301.  *    As of V39, diskfont.library will request underlining if specified
  302.  *    in the TextAttr, or TTextAttr passed to OpenDiskFont().  Diskfont
  303.  *    will first request Broken underlining (like the Text() function
  304.  *    does when SetSoftStyle() is used), and then Solid underlining if
  305.  *    the engine returns an error.  If the engine returns an error for
  306.  *    both, then diskfont.library attempts to find, or create the best
  307.  *    non-underlined font that it can. *)
  308.   underLined * = level0 + 24H;
  309.  
  310.   ulNone * = 0;
  311.   ulSolid * = 1;
  312.   ulBroken * = 2;
  313.   ulDoubleSolid * = 3;
  314.   outlDoubleBroken * = 4;
  315.  
  316. (*  ? strikeThrough is a boolean which is used to request
  317.  *    algorithimic strike through when rendering the glyph.
  318.  *    Bullet.library currently does not support this tag, though it
  319.  *    may be used by other engines in the future.  The default for
  320.  *    any engined which supports this tag must be FALSe.  Engines which
  321.  *    do not support this tag should return an appropriate err value. *)
  322.   strikeThrough * = level0 + 25H;
  323.  
  324. (********************************************************************)
  325. (* .otag tags *)
  326.  
  327. (* suffix for files in FONTS: that contain these tags *)
  328.    suffix * =      ".otag";
  329.  
  330. (* fileIdent both identifies this file and verifies its size.
  331.  * It is required to be the first tag in the file. *)
  332.    fileIdent * =   level1 + 01H;
  333.  
  334. (* engine specifies the font engine this file is designed to use *)
  335.    engine * =      level1 + indirect + 02H;
  336.    eBullet * =     "bullet";
  337.  
  338. (* family is the family name of this typeface *)
  339.    family * =      level1 + indirect + 03H;
  340.  
  341. (* The name of this typeface is implicit in the name of the .otag file *)
  342. (* bName is used to find the bold variant of this typeface *)
  343.    bName * =       level2 + indirect + 05H;
  344. (* iName is used to find the italic variant of this typeface *)
  345.    iName * =       level2 + indirect + 06H;
  346. (* biName is used to find the bold italic variant of this typeface *)
  347.    biName * =      level2 + indirect + 07H;
  348.  
  349. (* symSet is used to select the symbol set that has the otYSizeFactor
  350.  * described here.  Other symbol sets might have different extremes *)
  351.    symbolSet * =   level1 + 10H;
  352.  
  353. (* ySizeFactor is a ratio to assist in calculating the Point height
  354.  * to BlackHeight relationship -- high word: Point height term, low
  355.  * word: Black height term -- pointSize * = ysize*<high>/<low> *)
  356.    ySizeFactor * = level1 + 11H;
  357.  
  358. (* spaceWidth specifies the width of the space character relative
  359.  * to the character height *)
  360.    spaceWidth * =  level2 + 12H;
  361.  
  362. (* isFixed is a boolean indicating that all the characters in the
  363.  * typeface are intended to have the same character advance *)
  364.    isFixed * =     level2 + 13H;
  365.  
  366. (* serifFlag is a boolean indicating if the character has serifs *)
  367.    serifFlag * =   level1 + 14H;
  368.  
  369. (* stemWeight is an unsigned byte indicating the weight of the character *)
  370.    stemWeight * =  level1 + 15H;
  371.  
  372.    sUltraThin *  =   8;     (*   0- 15 *)
  373.    sExtraThin *  =  24;     (*  16- 31 *)
  374.    sThin *       =  40;     (*  32- 47 *)
  375.    sExtraLight * =  56;     (*  48- 63 *)
  376.    sLight *      =  72;     (*  64- 79 *)
  377.    sDemiLight *  =  88;     (*  80- 95 *)
  378.    sSemiLight *  = 104;     (*  96-111 *)
  379.    sBook *       = 120;     (* 112-127 *)
  380.    sMedium *     = 136;     (* 128-143 *)
  381.    sSemiBold *   = 152;     (* 144-159 *)
  382.    sDemiBold *   = 168;     (* 160-175 *)
  383.    sBold *       = 184;     (* 176-191 *)
  384.    sExtraBold *  = 200;     (* 192-207 *)
  385.    sBlack *      = 216;     (* 208-223 *)
  386.    sExtraBlack * = 232;     (* 224-239 *)
  387.    sUltraBlack * = 248;     (* 240-255 *)
  388.  
  389. (* slantStyle is an unsigned byte indicating the font posture *)
  390.    slantStyle * = level1 + 16H;
  391.    sUpright *    = 0;
  392.    sItalic *     = 1;       (* Oblique, Slanted, etc. *)
  393.    sLeftItalic * = 2;       (* Reverse Slant *)
  394.  
  395. (* horizStyle is an unsigned byte indicating the appearance width *)
  396.    horizStyle *       = level1 + 17H;
  397.    hUltraCompressed * =  16;     (*   0- 31 *)
  398.    hExtraCompressed * =  48;     (*  32- 63 *)
  399.    hCompressed *      =  80;     (*  64- 95 *)
  400.    hCondensed *       = 112;     (*  96-127 *)
  401.    hNormal *          = 144;     (* 128-159 *)
  402.    hSemiExpanded *    = 176;     (* 160-191 *)
  403.    hExpanded *        = 208;     (* 192-223 *)
  404.    hExtraExpanded *   = 240;     (* 224-255 *)
  405.  
  406. (* spaceFactor specifies the width of the space character relative
  407.  * to the character height *)
  408.    spaceFactor * = level2 + 18H;
  409.  
  410. (* inhibitAlgoStyle indicates which style bits, if any, should
  411.  * be ignored even if the font does not already have that quality.
  412.  * For example, if fsBold is set and the typeface is not bold but
  413.  * the user specifies bold, the application or diskfont library is
  414.  * not to use embolden to achieve a bold result. *)
  415.    inhibitAlgoStyle * = level2 + 19H;
  416.  
  417. (* availSizes is an indirect pointer to sorted UWORDs, 0th is count *)
  418.    availSizes * = level1 + indirect + 20H;
  419.    maxAvailSizes * =      20;      (* no more than 20 sizes allowed *)
  420.  
  421. (* specCount is the count number of parameters specified here *)
  422.    specCount * =  level1 + 100H;
  423.  
  424. (* specs can be created as appropriate for the engine by ORing in the
  425.  * parameter number (1 is first, 2 is second, ... up to 15th) *)
  426.    spec * =       level1 + 100H;
  427. (* spec1 is the (first) parameter to the font engine to select
  428.  * this particular typeface *)
  429.    spec1 * =      level1 + 101H;
  430.  
  431. (*
  432. **      $VER: glyph.h 9.1 (19.6.92)
  433. **
  434. **      glyph.h -- structures for glyph libraries
  435. **
  436. **      (C) Copyright 1991-1992 Robert R. Burns
  437. **          All Rights Reserved
  438. *)
  439.  
  440. TYPE
  441.  
  442. (* A GlyphEngine must be acquired via OpenEngine and is read-only *)
  443.   GlyphEnginePtr * = POINTER TO GlyphEngine;
  444.   GlyphEngine  * = RECORD
  445.     library - : e.LibraryPtr;   (* engine library *)
  446.     name -    : e.LSTRPTR;      (* library basename: e.g. "bullet" *)
  447.     (* private library data follows... *)
  448.   END;
  449.  
  450.   FIXED * = LONGINT;            (* 32 bit signed w/ 16 bits of fraction *)
  451.  
  452.   GlyphMapPtr * = POINTER TO GlyphMap;
  453.   GlyphMap  * = RECORD
  454.     bmModulo *     : e.UWORD;  (* # of bytes in row: always multiple of 4 *)
  455.     bmRows *       : e.UWORD;  (* # of rows in bitmap *)
  456.     blackLeft *    : e.UWORD;  (* # of blank pixel columns at left *)
  457.     blackTop *     : e.UWORD;  (* # of blank rows at top *)
  458.     blackWidth *   : e.UWORD;  (* span of contiguous non-blank columns *)
  459.     blackHeight *  : e.UWORD;  (* span of contiguous non-blank rows *)
  460.     xOrigin *      : FIXED;    (* distance from upper left corner of bitmap *)
  461.     yOrigin *      : FIXED;    (*   to initial CP, in fractional pixels *)
  462.     x0 *           : INTEGER;  (* approximation of XOrigin in whole pixels *)
  463.     y0 *           : INTEGER;  (* approximation of YOrigin in whole pixels *)
  464.     x1 *           : INTEGER;  (* approximation of XOrigin + Width *)
  465.     y1 *           : INTEGER;  (* approximation of YOrigin + Width *)
  466.     width *        : FIXED;    (* character advance, as fraction of em width *)
  467.     bitMap *       : e.APTR;   (* actual glyph bitmap *)
  468.   END;
  469.  
  470.   GlyphWidthEntryPtr * = POINTER TO GlyphWidthEntry;
  471.   GlyphWidthEntry  * = RECORD (e.MinNodeBase)
  472.     node *  : e.MinNode; (* on list returned by widthList inquiry *)
  473.     code *  : e.UWORD;   (* entry's character code value *)
  474.     width * : FIXED;     (* character advance, as fraction of em width *)
  475.   END;
  476.  
  477. (*
  478. **      $VER: oterrors.h 8.1 (19.6.92)
  479. **
  480. **      oterrors.h -- error results from outline libraries
  481. **
  482. **      (C) Copyright 1991-1992 Robert R. Burns
  483. **          All Rights Reserved
  484. *)
  485.  
  486. CONST
  487.  
  488. (* PRELIMINARY *)
  489.   errFailure *      = -1;  (* catch-all for error *)
  490.   errSuccess *      = 0;   (* no error *)
  491.   errBadTag *       = 1;   (* inappropriate tag for function *)
  492.   errUnknownTag *   = 2;   (* unknown tag for function *)
  493.   errBadData *      = 3;   (* catch-all for bad tag data *)
  494.   errNoMemory *     = 4;   (* insufficient memory for operation *)
  495.   errNoFace *       = 5;   (* no typeface currently specified *)
  496.   errBadFace *      = 6;   (* typeface specification problem *)
  497.   errNoGlyph *      = 7;   (* no glyph specified *)
  498.   errBadGlyph *     = 8;   (* bad glyph code or glyph range *)
  499.   errNoShear *      = 9;   (* shear only partially specified *)
  500.   errNoRotate *     = 10;  (* rotate only partially specified *)
  501.   errTooSmall *     = 11;  (* typeface metrics yield tiny glyphs *)
  502.   errUnknownGlyph * = 12;  (* glyph not known by engine *)
  503.  
  504.  
  505. (**-- Library Base variable --------------------------------------------*)
  506.  
  507. CONST
  508.  
  509.   diskfontName * = "diskfont.library";
  510.  
  511. VAR
  512.  
  513.   base *  : e.LibraryPtr;
  514.  
  515.  
  516. (**-- Library Functions ------------------------------------------------*)
  517.  
  518. (*
  519. **      $VER: diskfont_protos.h 38.0 (18.6.92)
  520. *)
  521.  
  522. PROCEDURE OpenDiskFont* [base,-30]
  523.   ( VAR textAttr [8] : gfx.TextAttr )
  524.   : gfx.TextFontPtr;
  525. PROCEDURE AvailFonts* [base,-36]
  526.   ( VAR buffer [8] : ARRAY OF SYS.BYTE;
  527.     bufBytes   [0] : LONGINT;
  528.     flags      [1] : s.SET32 )
  529.   : LONGINT;
  530.  
  531. (* --- functions in V34 or higher (distributed as Release 1.3) ---*)
  532.  
  533. PROCEDURE NewFontContents* [base,-42]
  534.   ( fontsLock [8] : d.FileLockPtr;
  535.     fontName  [9] : ARRAY OF CHAR )
  536.   : FontContentsHeaderPtr;
  537. PROCEDURE DisposeFontContents* [base,-48]
  538.   ( fontContentsHeader [9] : FontContentsHeaderPtr );
  539.  
  540. (* --- functions in V36 or higher (distributed as Release 2.0) ---*)
  541.  
  542. PROCEDURE NewScaledDiskFont* [base,-54]
  543.   ( sourceFont       [8] : gfx.TextFontPtr;
  544.     VAR destTextAttr [9] : gfx.TextAttr )
  545.   : DiskFontHeaderPtr;
  546.  
  547. (**-- Library Base variable --------------------------------------------*)
  548.  
  549. <*$LongVars-*>
  550.  
  551. (**-----------------------------------*)
  552. PROCEDURE* [0] CloseLib (VAR rc : LONGINT);
  553.  
  554. BEGIN (* CloseLib *)
  555.   IF base # NIL THEN e.CloseLibrary (base) END;
  556. END CloseLib;
  557.  
  558. BEGIN
  559.   base := e.OpenLibrary (diskfontName, e.libraryMinimum);
  560.   IF base = NIL THEN HALT (100) END;
  561.   Kernel.SetCleanup (CloseLib)
  562. END DiskFont.
  563.